package com.linewell.system.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotEmpty;

/**
 * 客户实体类 对应数据库表：SYS_CUSTOMER 
 */
@Entity
@Table(name = "SYS_CUSTOMER")
@DynamicInsert(true)
@DynamicUpdate(true)
public class SysCustomer implements Serializable {
	private static final long serialVersionUID = -6288383278071844189L;
	private Integer custId; // 客户id
	private SysDepartment sysDepartment;
	private String custName; // 用户姓名
	private String password;//密码
	private String phone; //联系电话
	private String sex; // 用户送货地址
    private String photo; //头像
	private Byte status; // 状态 0移除 1禁用 9正常(默认)
	
	@Id
	@Column(name = "CUST_ID", unique = true, nullable = false)
	@GeneratedValue(strategy = GenerationType.AUTO) // 自增长
	public Integer getCustId() {
		return custId;
	}

	public void setCustId(Integer custId) {
		this.custId = custId;
	}
	@Column(name = "PASSWORD")
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@ManyToOne(targetEntity = SysDepartment.class)
	@JoinColumn(name = "DEP_ID")
	public SysDepartment getSysDepartment() {
		return sysDepartment;
	}

	public void setSysDepartment(SysDepartment sysDepartment) {
		this.sysDepartment = sysDepartment;
	}

	@Column(name = "CUST_NAME")
	public String getCustName() {
		return custName;
	}

	public void setCustName(String custName) {
		this.custName = custName;
	}
	
	@Column(name = "PHONE")
	public String getPhone() {
		return phone;
	}	

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@Column(name = "SEX")
	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}
	
	@Column(name = "PHOTO")
	public String getPhoto() {
		return photo;
	}

	public void setPhoto(String photo) {
		this.photo = photo;
	}
	
	@Column(name = "STATUS", nullable = false, columnDefinition = "tinyint default 9")
	public Byte getStatus() {
		return status;
	}

	public void setStatus(Byte status) {
		this.status = status;
	}
}
